﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucDSLK.ascx.cs" Inherits="Admin_ucControl_ucDSLK" %>
<h1>
    Danh Mục Website Liên Kết
</h1>
<br />
<div>
    <asp:HyperLink ID="hyp" runat="server" NavigateUrl="~/Admin/DanhSachSanPham.aspx" Font-Size="Medium">Quay lại</asp:HyperLink>
</div>
<br />
<asp:Panel ID="Panel1" runat="server">
    <table class="th">
        <tr>
            <td valign="top" style="width: 70%; float: left">
                <table style="width: 100%">
                    <tr>
                        <th style="width: 150px">
                            Tên danh sách liên kết
                        </th>
                        <td>
                            <asp:TextBox ID="txtTen" runat="server" CssClass="inp-form"></asp:TextBox>
                            &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTen"
                                Text="*" Font-Bold="True" ForeColor="Red" ValidationGroup="save"></asp:RequiredFieldValidator><asp:Label
                                    ID="Label1" runat="server" Text="Example : www.sphc.com.vn" Enabled="false"></asp:Label></td>
                    </tr>
                    <tr>
                        <th style="width: 150px">
                            Địa chỉ website
                        </th>
                        <td>
                            <asp:TextBox ID="txtdiachiweb" runat="server" CssClass="inp-form"></asp:TextBox>
                            &nbsp;<asp:RequiredFieldValidator ID="reqCatename" runat="server" ControlToValidate="txtdiachiweb"
                                Text="*" Font-Bold="True" ForeColor="Red" ValidationGroup="save"></asp:RequiredFieldValidator><asp:Label
                                    ID="Label2" runat="server" Text="Example : http://sphc.com.vn" Enabled="false"></asp:Label></td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            <asp:Button ID="btAdd" runat="server" Text="Save" OnClick="btAdd_Click" ValidationGroup="save"
                                Height="26px" />
                            <asp:Button ID="btnReset" runat="server" Text="Reset" OnClick="btnReset_Click" />
                        </td>
                    </tr>
                </table>
            </td>
            <td>
                <asp:GridView ID="grdDSLK" runat="server" CellPadding="3" AutoGenerateColumns="False"
                    AllowPaging="True" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None"
                    BorderWidth="1px" ShowFooter="True" Width="550px" PageSize="4" 
                    OnPageIndexChanging="grdDSLK_PageIndexChanging" 
                    onrowdatabound="grdDSLK_RowDataBound">
                    <RowStyle ForeColor="#000066" />
                    <FooterStyle BackColor="White" ForeColor="#000066" />
                    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" Height="35px" />
                    <Columns>
                        <asp:TemplateField HeaderText="STT">
                            <ControlStyle Height="22px" />
                            <ItemStyle HorizontalAlign="Center" Width="30px" />
                            <ItemTemplate>
                                <asp:Label ID="STT" runat="server" Text="<%# ((grdDSLK.PageIndex * grdDSLK.PageSize) + grdDSLK.Rows.Count + 1)%>"></asp:Label></ItemTemplate>
                        </asp:TemplateField>
                        <asp:HyperLinkField DataTextField="Name" DataNavigateUrlFormatString="~/Admin/DanhSachLienKet.aspx?id={0}"
                            HeaderText="Tên Website Liên Kết" SortExpression="Name" DataNavigateUrlFields="ID">
                            <ItemStyle Width="150px" HorizontalAlign="Center"/>
                        </asp:HyperLinkField>
                        <asp:TemplateField HeaderText="Địa Chỉ Website ">
                            <ControlStyle Height="22px" />
                            <ItemStyle HorizontalAlign="Center" Width="150px" />
                            <ItemTemplate>
                                <%# Eval("NavigateUrl")%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Delete">
                            <ItemTemplate>
                                <asp:ImageButton ID="btnDelImg" runat="server" CausesValidation="false" CommandArgument='<%# Eval("ID") %>'
                                    CommandName="delete" ImageUrl="~/Admin/images/table/del.gif" OnClick="btnDelImg_Click" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
    </table>
</asp:Panel>
